package br.com.threads;

class One extends Thread{
	public void run(){
		int total = 0;
		for(int i = 1; i <= 5; i++){
			total += i;
			System.out.println("Total one: " + Thread.currentThread().getName() + total +" ");
		}
	}
}
public class Programa41 {
	public static void main(String[] args) {
		try{
		//System.out.println("Main");
		One o = new One();
		Thread t = new Thread(o);
		t.setName("Thread One -> ");
		t.start();	
		t.join();
		}catch(InterruptedException e){}		
	}
}
